﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Library.Bll;
using Library.Common;

namespace HanhuaMicroCredit.BLL
{
    public class NoticeBLL
    {

        //public static List<Dictionary<string, object>> getList()
        //{
        //    return CommonBLL.GetList(Database.Default, "Sys_Notice", "*", "CreateDate asc", "");
        //}
        public static List<Dictionary<string, object>> getDic(int id)
        {

            return CommonBLL.GetList(Database.Default, "Sys_Notice", "*", " id desc", "IsValid = 1 and id="+id);
        }
        public static string getNameById(string id, string Val, string tableName, string selectColumn)
        {
            if (string.IsNullOrWhiteSpace(Val))
                return "";
            string conditions = string.Format("{0}.{1} = '{2}'", tableName, id, Val);
            Dictionary<string, object> d = CommonBLL.GetModel(Database.WebDigData,tableName, selectColumn, conditions);
            if (d != null)
                return d[selectColumn.ToLower()].ToString();
            return "";
        }
    }
}
